<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/layout.css" />
  <script type="text/javascript" src="__PUBLIC__/Js/jquery.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Js/main.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Js/jquery-ui.min.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Js/yanue.pop.js"></script>
 
</head>
<body>
  <div class="OA_main">
     <div class="OA_welcom_left"></div>
	 <iframe src="__APP__/Public/main_info" frameborder="no" style="height:auto;width:95%;
height:82px;float:left;overflow:hidden;" target="main"></iframe>
     <div class="OA_welcom_right"></div>
     
     <div class="OA_main_content">
        <div class="OA_main_left">
            <!--公告通知版块开始-->
            <?php if($user_info[0]['u_window'] == '1'): ?><div class="OA_main_L1 S_1" style="left:<?php echo ($ab_info[0]['a_left']); ?>px;top:<?php echo ($ab_info[0]['a_top']); ?>px;z-index:<?php echo ($ab_info[0]['a_zIndex']); ?>">
                <h1>公告通知</h1>
                <ul>
                <?php if($n == '2'): ?><span style="font-size:15px;color:red;">对不起,暂无公告通知...</span><?php endif; ?>
                   <?php if(is_array($n_info)): $i = 0; $__LIST__ = $n_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><?php echo ($v["n_title"]); ?><span style="float:right;"><?php echo (date("Y-m-d",$v["n_addtime"])); ?>&nbsp;&nbsp;<i><?php echo ($v["n_department"]); ?>发布</i></span></li><?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </div>
            <?php else: ?>
            <div class="OA_main_L1 S_1">
                <h1>公告通知</h1>
                <ul>
                <?php if($n == '2'): ?><span style="font-size:15px;color:red;">对不起,暂无公告通知...</span><?php endif; ?>
                   <?php if(is_array($n_info)): $i = 0; $__LIST__ = $n_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><?php echo ($v["n_title"]); ?><span style="float:right;"><?php echo (date("Y-m-d",$v["n_addtime"])); ?>&nbsp;&nbsp;<i><?php echo ($v["n_department"]); ?>发布</i></span></li><?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </div><?php endif; ?>
            <!--公告通知版块结束-->
            <!--公共交流版块开始-->
            <?php if($user_info[0]['u_window'] == '1'): ?><div class="OA_main_L2 S_2" style="left:<?php echo ($ab_info[1]['a_left']); ?>px;top:<?php echo ($ab_info[1]['a_top']); ?>px;z-index:<?php echo ($ab_info[1]['a_zIndex']); ?>">
                <h1>公共交流频道<span style="float:right;margin-right:5px;"><a href="__APP__/ChatChannel/publicChannel" style="font-size:12px;color:red">【进入交流室】</a></span></h1>
                <ul>
                <?php if($c == '2'): ?><span style="font-size:15px;color:red;">对不起,暂无交流记录...</span><?php endif; ?>
                  <?php if(is_array($c_info)): $i = 0; $__LIST__ = $c_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><?php echo (substr($v["c_msg"],0,30)); ?>...<span style="float:left;">>>&nbsp;<?php echo (date("Y-m-d H:m",$v["c_time"])); ?>&nbsp;&nbsp;<i><?php echo ($v["c_user"]); ?>&nbsp;:&nbsp;</i></span></li><?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </div>
            <?php else: ?>
            <div class="OA_main_L2 S_2">
                <h1>公共交流频道<span style="float:right;margin-right:5px;"><a href="__APP__/ChatChannel/publicChannel" style="font-size:12px;color:red">【进入交流室】</a></span></h1>
                <ul>
                <?php if($c == '2'): ?><span style="font-size:15px;color:red;">对不起,暂无交流记录...</span><?php endif; ?>
                  <?php if(is_array($c_info)): $i = 0; $__LIST__ = $c_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><?php echo (substr($v["c_msg"],0,30)); ?>...<span style="float:left;">>>&nbsp;<?php echo (date("Y-m-d H:m",$v["c_time"])); ?>&nbsp;&nbsp;<i><?php echo ($v["c_user"]); ?>&nbsp;:&nbsp;</i></span></li><?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </div><?php endif; ?>
            <!--公共交流版块结束-->
        </div>    
        <!--备忘录版块开始-->
        <?php if($user_info[0]['u_window'] == '1'): ?><div class="OA_main_content S_3" style="left:<?php echo ($ab_info[2]['a_left']); ?>px;top:<?php echo ($ab_info[2]['a_top']); ?>px;z-index:<?php echo ($ab_info[2]['a_zIndex']); ?>">
            <div class="OA_main_C1">
               <span><img src="__PUBLIC__/Images/OA_main14.jpg" /></span>
               <span class="OA_main_C1_span">
                  <button class="button_1"></button>
                  <b id="time_info"><?php echo (date("Y-m",$now_time)); ?></b>
                  <button class="button_2"></button>
               </span>
            </div>
            <ul class="OA_main_C2">
               <!--<?php $__FOR_START_30283__=1;$__FOR_END_30283__=31;for($i=$__FOR_START_30283__;$i < $__FOR_END_30283__;$i+=1){ ?><li><a href="#"><?php echo ($i); ?></a></li><?php } ?>-->
            </ul> 
            <div class="OA_main_C3">
               <span id="d_click" style="cursor:pointer;">当天</span>
               <p id="memo_msg">内容...</p>
            </div>
            <div class="OA_main_C4">
               <span>添加新备忘:</span><br/>
               <textarea id="memo_value"></textarea>
            </div>
            <div class="OA_main_C5">
               <input type="image" src="__PUBLIC__/Images/OA_main19.jpg" id="add_memo" />
            </div>
        </div>
        <?php else: ?>
        <div class="OA_main_content S_3">
            <div class="OA_main_C1">
               <span><img src="__PUBLIC__/Images/OA_main14.jpg" /></span>
               <span class="OA_main_C1_span">
                  <button class="button_1"></button>
                  <b id="time_info"><?php echo (date("Y-m",$now_time)); ?></b>
                  <button class="button_2"></button>
               </span>
            </div>
            <ul class="OA_main_C2">
               <!--<?php $__FOR_START_13091__=1;$__FOR_END_13091__=31;for($i=$__FOR_START_13091__;$i < $__FOR_END_13091__;$i+=1){ ?><li><a href="#"><?php echo ($i); ?></a></li><?php } ?>-->
            </ul> 
            <div class="OA_main_C3">
               <span id="d_click" style="cursor:pointer;">当天</span>
               <p id="memo_msg">内容...</p>
            </div>
            <div class="OA_main_C4">
               <span>添加新备忘:</span><br/>
               <textarea id="memo_value"></textarea>
            </div>
            <div class="OA_main_C5">
               <input type="image" src="__PUBLIC__/Images/OA_main19.jpg" id="add_memo" />
            </div>
        </div><?php endif; ?>
        <!--备忘录版块结束-->
  
        <div class="OA_main_right">
            <!--投票中心版块开始-->
            <?php if($user_info[0]['u_window'] == '1'): ?><div class="OA_main_TouPiao S_4"  style="left:<?php echo ($ab_info[3]['a_left']); ?>px;top:<?php echo ($ab_info[3]['a_top']); ?>px;z-index:<?php echo ($ab_info[3]['a_zIndex']); ?>">
                <h1>投票中心<span style="float:right;margin-right:5px;"><a href="#" style="font-size:12px;color:red">【查看更多】</a></span></h1>
                <ul>
                  <?php if(is_array($v_info)): $i = 0; $__LIST__ = $v_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li style='height:40px;margin-top:5px;'><a href="__APP__/Vote/user_vote">★【快来参与】<?php echo ($v["v_title"]); ?></a><p style="color:#999">开始时间:<?php echo (date("Y-m-d",$v["v_starttime"])); ?>&nbsp;&nbsp;结束时间:<?php echo (date("Y-m-d",$v["v_endtime"])); ?></p></li><?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </div>
            <?php else: ?>
            <div class="OA_main_TouPiao S_4">
                <h1>投票中心<span style="float:right;margin-right:5px;"><a href="#" style="font-size:12px;color:red">【查看更多】</a></span></h1>
                <ul>
                <?php if(is_array($v_info)): $i = 0; $__LIST__ = $v_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li style='height:40px;margin-top:5px;'><a href="__APP__/Vote/user_vote">★【快来参与】<?php echo ($v["v_title"]); ?></a><p style="color:#999">开始时间:<?php echo (date("Y-m-d",$v["v_starttime"])); ?>&nbsp;&nbsp;结束时间:<?php echo (date("Y-m-d",$v["v_endtime"])); ?></p></li><?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
            </div><?php endif; ?>
            <!--投票版块结束-->
            <!--话题交流版块开始-->
           <!--  <?php if($user_info[0]['u_window'] == '1'): ?><div class="OA_main_HuaTi S_5" style="left:<?php echo ($ab_info[4]['a_left']); ?>px;top:<?php echo ($ab_info[4]['a_top']); ?>px;z-index:<?php echo ($ab_info[4]['a_zIndex']); ?>">
               <h1>话题交流<span style="float:right;margin-right:5px;"><a href="#" style="font-size:12px;color:red">【查看更多】</a></span></h1>
               <ul>
                 2.0后期版本加入...暂未开放...
               </ul>
            </div>
            <?php else: ?>
            <div class="OA_main_HuaTi S_5">
               <h1>话题交流<span style="float:right;margin-right:5px;"><a href="#" style="font-size:12px;color:red">【查看更多】</a></span></h1>
               <ul>
                 2.0后期版本加入...暂未开放...
               </ul>
            </div><?php endif; ?> -->
            <!--话题交流版块结束-->
        </div>
     </div>
     
     <!--网站地图版块开始-->
     <?php if($user_info[0]['u_window'] == '1'): ?><div class="OA_main_map S_6"  style="left:<?php echo ($ab_info[5]['a_left']); ?>px;top:<?php echo ($ab_info[5]['a_top']); ?>px;z-index:<?php echo ($ab_info[5]['a_zIndex']); ?>">
        <div class="OA_main_mapTop1"></div> 
        <div class="OA_main_mapTop2">
           <ul>
             <li><span>工作日志</span><em></em></li>
             <li><span>个人文件柜</span><em></em></li>
             <li><span>常用网址</span><em></em></li>
             <li><span>会议安排</span><em></em></li>
           </ul>          
        </div>
        <div class="OA_main_mapTop3"></div>
        
        <div class="OA_mian_mapContent">
           <ul class="log">
             <?php if(is_array($j_info)): $i = 0; $__LIST__ = $j_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><img src="__PUBLIC__/Images/OA_main26.jpg" />&nbsp;<a href="__APP__/JobLog/look_jobLog/j_id/<?php echo ($v["j_id"]); ?>"><?php echo (substr($v["j_content"],0,25)); ?>...</a></li><?php endforeach; endif; else: echo "" ;endif; ?>
           </ul>
           
           <ul class="file">
             <?php if(is_array($f_info)): $i = 0; $__LIST__ = $f_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i; if($v["f_type"] == 'exe'): ?><li><img src="__PUBLIC__/Images/OA_main28.jpg" />&nbsp;<a href="<?php echo ($v["f_path"]); echo ($v["f_filename"]); ?>"><?php echo ($v["f_newname"]); ?></a></li>
             <?php elseif(($v["f_type"] == 'jpg') or ($v["f_type"] == 'png') or ($v["f_type"] == 'gif')): ?>
             <li><img src="__PUBLIC__/Images/OA_main27.jpg" />&nbsp;<a href="<?php echo ($v["f_path"]); echo ($v["f_filename"]); ?>"><?php echo (substr($v["f_newname"],0,30)); ?>...</a></li>
             <?php else: ?>
             <li><img src="__PUBLIC__/Images/OA_main29.jpg" />&nbsp;<a href="<?php echo ($v["f_path"]); echo ($v["f_filename"]); ?>"><?php echo ($v["f_newname"]); ?></a></li><?php endif; endforeach; endif; else: echo "" ;endif; ?>
          </ul>
          
         <ul class="url" id="show_url">
             <?php if(is_array($u_info)): $i = 0; $__LIST__ = $u_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li class="_url" title="<?php echo ($v["u_url"]); ?>"><img src="__PUBLIC__/Images/OA_main30.jpg"/>&nbsp;<a href="<?php echo ($v["u_url"]); ?>" target="_top"><?php echo (substr($v["u_url"],0,28)); ?></a><span style="float:right;margin-right:5px;cursor:pointer;display:inherit;color:green" class='update_url'>[更新]</span></li><?php endforeach; endif; else: echo "" ;endif; ?>
           </ul>
           
           <ul class="xxx">
             <?php if(is_array($meet_info)): $i = 0; $__LIST__ = $meet_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><img src="__PUBLIC__/Images/OA_main26.jpg" />&nbsp;<a href="#">主题:<?php echo ($v["m_title"]); ?> <a href="__APP__/Meeting/huiyi_info/m_id/<?php echo ($v["m_id"]); ?>"  >【查看详细】</a></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
           </ul>
        </div>       
     </div>
     <?php else: ?>
     <div class="OA_main_map S_6">
        <div class="OA_main_mapTop1"></div> 
        <div class="OA_main_mapTop2">
           <ul>
             <li><span>工作日志</span><em></em></li>
             <li><span>个人文件柜</span><em></em></li>
             <li><span>常用网址</span><em></em></li>
             <li><span>会议安排</span><em></em></li>
           </ul>          
        </div>
        <div class="OA_main_mapTop3"></div>
        
        <div class="OA_mian_mapContent">
           <ul class="log">
             <?php if(is_array($j_info)): $i = 0; $__LIST__ = $j_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><img src="__PUBLIC__/Images/OA_main26.jpg" />&nbsp;<a href="__APP__/JobLog/look_jobLog/j_id/<?php echo ($v["j_id"]); ?>"><?php echo (substr($v["j_content"],0,25)); ?>...</a></li><?php endforeach; endif; else: echo "" ;endif; ?>
           </ul>
           
           <ul class="file">
             <?php if(is_array($f_info)): $i = 0; $__LIST__ = $f_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i; if($v["f_type"] == 'exe'): ?><li><img src="__PUBLIC__/Images/OA_main28.jpg" />&nbsp;<a href="<?php echo ($v["f_path"]); echo ($v["f_filename"]); ?>"><?php echo ($v["f_newname"]); ?></a></li>
             <?php elseif(($v["f_type"] == 'jpg') or ($v["f_type"] == 'png') or ($v["f_type"] == 'gif')): ?>
             <li><img src="__PUBLIC__/Images/OA_main27.jpg" />&nbsp;<a href="<?php echo ($v["f_path"]); echo ($v["f_filename"]); ?>"><?php echo (substr($v["f_newname"],0,30)); ?>...</a></li>
             <?php else: ?>
             <li><img src="__PUBLIC__/Images/OA_main29.jpg" />&nbsp;<a href="<?php echo ($v["f_path"]); echo ($v["f_filename"]); ?>"><?php echo ($v["f_newname"]); ?></a></li><?php endif; endforeach; endif; else: echo "" ;endif; ?>
          </ul>
          
         <ul class="url" id="show_url">
             <?php if(is_array($u_info)): $i = 0; $__LIST__ = $u_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li class="_url" title="<?php echo ($v["u_url"]); ?>"><img src="__PUBLIC__/Images/OA_main30.jpg"/>&nbsp;<a href="<?php echo ($v["u_url"]); ?>" target="_top"><?php echo (substr($v["u_url"],0,28)); ?></a><span style="float:right;margin-right:5px;cursor:pointer;display:inherit;color:green" class='update_url'>[更新]</span></li><?php endforeach; endif; else: echo "" ;endif; ?>
           </ul>
           
           <ul class="xxx">
             <?php if(is_array($meet_info)): $i = 0; $__LIST__ = $meet_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><img src="__PUBLIC__/Images/OA_main26.jpg" />&nbsp;<a href="#">主题:<?php echo ($v["m_title"]); ?> <a href="__APP__/Meeting/huiyi_info/m_id/<?php echo ($v["m_id"]); ?>"  >【查看详细】</a></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
           </ul>
        </div>       
     </div><?php endif; ?>
     <!--网站地图版块结束-->
     
     <div class="OA_footer">
         <p>公司名称:<?php echo ($company_info[0]['c_cname']); ?> 公司电话:<?php echo ($company_info[0]['c_cphone']); ?></p>
     </div>
  </div>
 
 <div id="pop" style="display:none;"> 
  <div id="popHead">
	<a id="popClose" title="关闭">关闭</a>
	<h2>公司紧急通告</h2>
	</div>
	<div id="popContent">
	<dl>
		<dt id="popTitle"><a href="#" target="_blank">这里是参数</a></dt>
		<dd id="popIntro">这里是内容简介</dd>
	</dl>
	<!--<p id="popMore"><a href="#" target="_blank">查看 »</a></p>-->
	</div>
  </div>
 </div>
</body>
  <script type="text/javascript" >
	  //记得加载jquery
	  //使用参数：1.标题，2.链接地址，3.内容简介
	  window.onload=function(){
			var pop=new Pop("<?php echo ($jinji_info['j_title']); ?>",
			"",
			"<?php echo ($jinji_info['j_content']); ?>");
	  }
	  
	 
	 
	  
	  //日历程序部
	var now_time = $("#time_info").text(); //获取当前年月
	
	//获取到当前系统时间，并组合成年-月-日的格式
	var now_date = new Date();
	var d_year = now_date.getFullYear();
	var d_month = (now_date.getMonth()+1);
	var d_day = now_date.getDate();
	if(d_month < 10){
	   d_month = "0"+d_month;	
	}
	var d_date = d_year+"-"+d_month+"-"+d_day;
	
	var time_arr = now_time.split("-");
	var new_month = time_arr[1];
	month_day(new_month,now_time); //调用函数计算月份天数并显示在前台
	
	//页面加载完成后模拟点击 当前日期的LI元素
	$(".OA_main_C2").find("li>a[title='"+d_date+"']").trigger("click");
	
	var new_year  = time_arr[0];
	var new_time;
	var lis = "";
	$(".button_1").click(function(){	
	    $(".OA_main_C2").html("");
		new_month = (new_month-1);
		if(new_month < 1){
		   new_month = 1;
		   alert("对不起,只能对当前年份进行备忘录的添加");
		}
		if(new_month < 10){
		   new_month = "0"+new_month;	
		}
		
		new_time = new_year+"-"+new_month;
		month_day(new_month,new_time); //调用函数计算月份天数并显示在前台
	    $("#time_info").text(new_time);
	});
	
	$(".button_2").click(function(){
		$(".OA_main_C2").html("");
		new_month = parseInt(new_month);
		new_month = (new_month+1);
		if(new_month > 12){
		   new_month = 12;	
		   alert("对不起,只能对当前年份进行备忘录的添加");
		}
		if(new_month < 10){
		   new_month = "0"+new_month;	
		}				
		new_time = new_year+"-"+new_month;
		month_day(new_month,new_time); //调用函数计算月份天数并显示在前台
	    $("#time_info").text(new_time);
	});
	
	
	//计算月份中的天数 并创建相应元素
	function month_day(month,time){
		month = parseInt(month);
	   	switch(month){
		    case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
			  for(var i=1;i<=31;i++){
				$(".OA_main_C2").append($("<li><a href='#' title='"+time+"-"+i+"'>"+i+"</a></li>"));
			  }			  
			break;
			case 4:
			case 6:
			case 9:
			case 11:
			  for(var i=1;i<=30;i++){
				$(".OA_main_C2").append($("<li><a href='#' title='"+time+"-"+i+"'>"+i+"</a></li>"));
			  }	
			break;
			case 2:
			  for(var i=1;i<=28;i++){
				$(".OA_main_C2").append($("<li><a href='#' title='"+time+"-"+i+"'>"+i+"</a></li>"));
			  }	
			break;     	
		}
				
		$(".OA_main_C2").find("li >a ").click(function(){
			 $(".OA_main_C2").find("li >a ").removeClass("hover_lis");
			 $(this).addClass("hover_lis");
		     title = $(this).attr("title");
			 //获取当前项目的目录
			 $.get("__URL__/main_ajax",{
				  nowTimes : title
			 },function(data){
				  var msg = $("<font color=green>"+data+"</font>")
				  $("#memo_msg").html(msg);
			 });
	    });
		
	}
	
	
	//点击当天按钮处理
		$("#d_click").click(function(){
			 $(".OA_main_C2").find("li>a[title='"+d_date+"']").trigger("click");
		});
		
    //添加备忘录
	$("#add_memo").click(function(){
		var v = $("#memo_value").val();
		if(v==""){
		   alert("对不起,请添加备忘内容");	
		}

		$.get("__URL__/add_memo",{
			  value : v,
			  d_times : title
		},function(data){
			  if(data==1){
				 alert("备忘录添加成功");
				 $("#memo_value").val("");  				 
			  }else if(data==2){
				 alert("备忘录添加失败");  
			  }else{
				 alert("对不起,您当天已经添加过备忘录了");  
			  }
		});
	});
	
	//双击修改备忘录
	var memo_i = 0; //禁止重复添加更新内容框
	$("#memo_msg").dblclick(function(){
		if(memo_i == 0){
			$(this).append("<textarea cols=30 rows=4 id='update_memo' style='border:1px solid #f0f0f0;'></textarea>");
			    memo_i = 1; 
		    $("#update_memo").focus();
	    }
		
		//焦点离开时保存信息
		$("#update_memo").blur(function(){
			if(this.value==""){
			      location.reload();
			}else{		
		    	  var update_v = $(this).val();
				  $.get("__URL__/update_memo",{
				 	value : update_v,
			     	d_times : title
				  },function(data){
					  if(data==1){
				 	     alert("备忘录信息更新成功");
				 	     location.reload();
			    	  }else{
				 	     alert("备忘录更新失败");  
			    	  }
				 });
			}
	    });
	});
	
	//常用网址设置
	var url_i = 0;
	$(".update_url").click(function(){
		var url_title = $(this).parent().attr("title");
		var index = ($(".update_url").index(this)+1);
		if(url_i == 0){
		$(this).prev().remove();
		$(this).parent().append("&nbsp;<input type='text' style='width:140px;height:25px;border:1px solid #ccc;' id='url_value' value="+url_title+">");
		   $("#url_value").focus();
		   url_i = 1;
		}
		
		$("#url_value").blur(function(){
			var url_value = $("#url_value").val();
			$.get("__URL__/add_url",{
				 u_number : index,
				 u_url : url_value
			},function(data){
				if(data==1){
				   alert("网址添加成功");
				   location.reload();
				}else{
				   alert("网址添加失败");	
				}
			});
		});
	});
	
	 //拖动JS 
	 <?php if($user_info[0]['u_window'] == '1'): if(is_array($section_info)): $i = 0; $__LIST__ = $section_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>make_draggable($('.S_'+<?php echo ($v["s_id"]); ?>),<?php echo ($v["s_id"]); ?>);<?php endforeach; endif; else: echo "" ;endif; endif; ?>
	   var zIndex = 0;

       function make_draggable(elements,sectionID){   
      	  elements.draggable({   
        	opacity: 0.8,   
        	containment:'document.body',   
       	    start:function(e,ui){ ui.helper.css('z-index',++zIndex);},   
        	stop:function(e,ui){ 

               $.get('__URL__/save_absolute',{   
                  x        : ui.position.left,   
                  y        : ui.position.top,   
                  z        : zIndex, 
				  sid      : sectionID 
               },function(data){
				  if(data!=1){
					 alert('个人办公桌位置保存失败~。~！');    
				  }
			   }); 
        	}   
          })  
	   }
	   
</script>
</html>